package com.lyz.dataStructure.algorithm.wangyi2020;

import java.util.Scanner;

/**
 *@Author:759057893@qq.com Lyz
 *@Date: 2019/8/3 16:24
 *@Description:
 **/
public class Main1 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] arr = new int[n];
        for(int i =0;i<arr.length;i++){
            arr[i] = sc.nextInt();
        }

        for(int i = 0;i<arr.length-1;i++){
            for(int j = 0; j<arr.length-i-1;j++){
                if((arr[i]+arr[j])%2!=0){
                    int  a = arr[j];
                    arr[j] = arr[i];
                    arr[i] =a ;
                }
            }
        }
       for(int i = 0; i<arr.length;i++){
           System.out.print(arr[i]+" ");
       }
    }
}
